import { Rule } from "antd/es/form";

export const phoneRule: Rule = {
	pattern: /^(13[0-9]{9}$|14[0-9]{9}|15[0-9]{9}$|18[0-9]{9})$|(^(0\d{10})|^(0\d{2}-\d{8}))$/,
	message: '请输入正确的手机号码',
	required: true
}

export const usernameRule: Rule = {
	min: 3,
	max: 10,
	required: true,
	message: '输入3-10个任意字符的用户名'
}

export const passwordRule: Rule = {
	min: 8,
	max: 20,
	required: true,
	message: '请输入8-20个任意字符的密码'
}

export const carNumberRule: Rule = {
	pattern: /^[京津沪渝冀豫云辽黑湘皖鲁新苏浙赣鄂桂甘晋蒙陕吉闽贵粤青藏川宁琼使领A-Z]{1}[A-Z]{1}[A-Z0-9]{4}[A-Z0-9挂学警港澳]{1}$/,
	required: true,
	message: '请输入正确的车牌号'
}
